/*
 * @Author: ZhangPeng irocky@email.cn
 * @Date: 2023-02-11 17:41:14
 * @Description:
 * @RoutePath:
 * Copyright (c) 2023 by ${git_name}, All Rights Reserved.
 */
import { UserState } from '@/store/modules/user/types';

export interface BaseResponse<T = unknown> {
  msg: string;
  code: number;
  data?: T;
}

export interface HttpResponse extends BaseResponse {
  status: number;
}

export interface LoginData {
  code: string;
  username: string;
  password: string;
  uuid: string;
}

// 约定返回数据data字段里的对象
export interface CaptchaImgRes extends BaseResponse {
  captchaEnabled: boolean;
  img: string;
  uuid: string;
}

export interface LoginRes {
  token: string;
}

export interface UserRes extends UserState {
  code: number;
  msg: '';
}

export interface RouterRes {
  component: string;
  children?: Array<RouterRes>;
  hidden: boolean;
  permissions?: Array<string>;
  roles?: Array<string>;
  meta?: {
    title: string;
    icon: string;
    noCache: boolean;
    link: any;
  };
  name: string;
  path: string;
  alwaysShow?: string;
  redirect?: string;
}

export interface Menu {
  menuId: number;
  menuName: string;
  icon?: string;
  path: string;
  parentId: number;
  children?: Menu[];
}
